const express = require('express');
const loginRouter = require('./routers/loginRouter')
const userRouter = require('./routers/userRouter')
const mVerifyToken = require('./middlewares/mVerifyToken');
const CORS = require('./middlewares/setCORS')
let app = express();

app.use(express.urlencoded({ extended: false }))
app.use(express.json())
app.use(express.static(__dirname + '/public'))
app.use(CORS)

app.listen(80, () => {
    console.log("启动80端口成功");
})

app.use('/admin', loginRouter)
app.use('/admin', mVerifyToken, userRouter)